@import '../../../node_modules/components-font-awesome/less/font-awesome';
@import '../../../node_modules/bootstrap/less/bootstrap';
@import 'variables';
@import 'mixins';
@import '../chartist/chartist';
@import '../gridstack/gridstack';
@import '../../../node_modules/bootstrap-sweetalert/lib/sweet-alert';
@import 'commit-blocks';

@import 'site';
@import 'score';

// TODO: remove
#__bs_notify__ { display: none !important;}

// FONT AWESOME
// ========================================
@fa-font-path: '../fonts';

// BOOTSTRAP VARIABLES
// ========================================
@icon-font-path: '../fonts/';
@link-color: @dash-text;
@link-hover-decoration: 'none';
@table-border-color: transparent;
@modal-content-bg: @dash-modal-bg;

// BOOTSTRAP EXTENSIONS
// ========================================
.modal-backdrop {
    bottom: 0; // fix for 3.3.1
}

.modal-lg {
    width: 960px;
}

.tab-content {
    background: @nav-tabs-active-link-hover-bg;
    border: 1px solid @nav-tabs-border-color;
    border-top: 0;
}

// CHARTIST VARIABLES
// ========================================
@ct-series-colors: @dash-status-pass, @dash-status-fail, @dash-status-warn, @dash-text;
@ct-text-color: @dash-dashboard-text;
@ct-area-opacity: @dash-chart-area-opacity;
@ct-text-color: @dash-chart-text-color;
@ct-line-width: @dash-chart-line-width;
@ct-point-size: @dash-chart-point-size;
@ct-bar-width: @dash-chart-bar-width;
@ct-horizontal-text-align: @dash-chart-horizontal-text-align;
@ct-grid-color: @dash-chart-grid;

// CHARTIST OVERRIDES
// ========================================
#dashboard, .modal-content {
    // defining alternative chart colors
    .ct-chart.dash-chart-alt .ct-series {
        .ct-line, .ct-point, .ct-bar, .ct-donut {
            stroke: @dash-chart-alt-color;
        }

        .ct-slice:not(.ct-donut), .ct-area {
            fill: @dash-chart-alt-fill;
        }
    }

    // style for the pointHalo plugin
    .ct-point-halo {
        stroke: @dash-chart-halo-color;
        stroke-width: @dash-chart-halo-size;
    }

    // style for the tooltip plugin. makes tooltip trigger area larger
    .ct-tooltip-trigger-area {
        stroke: transparent;
        stroke-linecap: round;
        stroke-width: @dash-chart-point-size + 10;
    }

    // style for the threshold plugin line
    .ct-grid.ct-grid-threshold {
        stroke: @dash-status-fail;
        stroke-dasharray: none;
    }
}

.modal-content {
    .ct-label {
        color: @dash-text;
    }

    text.ct-label {
        fill: @dash-text;
    }

    .ct-grid {
        stroke: @modal-content-bg;
    }

    .tooltip {
        @modal-tooltip-bg: darken(@modal-content-bg, 10%);
        .tooltip-inner {
            background-color: @modal-tooltip-bg;
            max-width: none;
            .tooltip-row {
                white-space: nowrap;
                display: block;
            }

            .tooltip-left {
                text-align: left;
            }
        }

        &.top .tooltip-arrow {
            border-top-color: @modal-tooltip-bg;
        }

        &.bottom .tooltip-arrow {
            border-bottom-color: @modal-tooltip-bg;
        }

        &.left .tooltip-arrow {
            border-left-color: @modal-tooltip-bg;
        }

        &.right .tooltip-arrow {
            border-right-color: @modal-tooltip-bg;
        }
    }
}

// OTHER
// ========================================
// make all elements fill the screen
html, body, #container {
    height: 100%;
}

// specify basic styles for all pages
body {
    background: @dash-bg;
    color: @dash-text;
}

// remove the outline so we don't have it show with popovers
:focus {
    outline: none;
}

// have views fill containing area
#container > div {
    min-height: 100%;
}

// class to add pointer icon
.clickable {
    cursor: pointer;
}

// animates the appearance of elements. place on containing elements of an ng-repeat
.list-animate {
    .animate-appear();
}

.list-group-item-right {
    font-size: 2em;
    .center-y;
    right: @padding-base-horizontal;
}


// a little bigger button
.btn-wide {
    padding-left: @dash-btn-wide;
    padding-right: @dash-btn-wide;
}

.btn-wide-2x {
    padding-left: @dash-btn-wide-2x;
    padding-right: @dash-btn-wide-2x;
}

// Success appears as green
.btn-default {
    .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border);
}
.btn-secondary {
    .button-variant(@dash-btn-secondary-color; @dash-btn-secondary-bg; @dash-btn-secondary-border);
}
.btn-primary {
    .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);
}
// Success appears as green
.btn-success {
    .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border);
}
// Info appears as blue-green
.btn-info {
    .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);
}
// Warning appears as orange
.btn-warning {
    .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border);
}
// Danger and error appear as red
.btn-danger {
    .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border);
}

.btn-input {
    //.button-variant(@input-color; @input-bg; @input-border);
    color: @input-color !important;
    background-color: @input-bg !important;
    border-color: @input-border !important;

    .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
}

.gap, .button-row {
    margin-top: 3.5rem;
}

// animation for screen transitions
.screen-fade {
    opacity: 1;
    @fade-timing: 250ms;

    .transition(opacity @fade-timing ease-in-out);

    &.ng-enter, &.ng-leave.ng-leave-active {
        opacity: 0;
    }
    &.ng-enter.ng-enter-active {
        opacity: 1;
        .transition-delay(@fade-timing);
    }
}

.welcome-header {
    color: @dash-text-inverse;
    font-size: 1.5rem;
    position: relative;
    top: 5px;

    .fa-stack {
        cursor: pointer;

        .fa-circle {
            color: darken(@navbar-inverse-bg, 20%);
            opacity: 0;
            .transition(opacity .2s linear);
        }

        &:hover {
            .fa-circle {
                opacity: 1;
            }
        }
    }
}

// FORMS
// ========================================
// help blocks show validation errors but should start hidden
.form-group .help-block {
    display: none;
}

// show error
.form-group.has-error .help-block {
    display: block;
}

// wrap around a form control when in line with floated elements
.form-control-inline-container {
    display: block;
    overflow: hidden;
}

// makes smaller input items
.form-control-inline {
    .form-control;

    width: auto;
    max-width: 100%;
    display: inline-block;
}

//
// ========================================
#header {
    color: @dash-header-text;
    display: block !important;
    background: @dash-header-bg;
    font-size: @dash-header-font-size;
    line-height: 48px;
    text-align: center;
    position: relative;
    margin-bottom: 50px;

    .dashboard-logo {
        background: url(@dash-header-logo-url) no-repeat center center;
        background-size: contain;
        display: inline-block;
        position: absolute;
        left: @dash-header-logo-left;
        top: @dash-header-logo-top;
        width: @dash-header-logo-width;
        height: @dash-header-logo-height;


        &.dashboard-logo-inverse {
            background-image: url(@dash-header-logo-inverse-url);
        }
    }

    // switch between pipeline view
    .pipeline-toggle {
        position: absolute;
        right: 1rem;
        top: 1rem;
    }
    .divider {
        width: 5px;
        height: auto;
        display: inline-block;
    }
}

#footer {
    display: block;
    position: fixed;
    bottom: 0;
    line-height: 2rem;
    width: 100%;
    text-align: center;
}

// WIDGET
// ========================================
.widget {
    padding: 2.5rem 3rem;
    .border-radius(@dash-widget-border-radius);

    .widget {
        margin-bottom: 2rem;
    }

    // heading in a widget
    .widget-heading {
        border-bottom: 1px solid @dash-widget-heading-border;
        color: @dash-widget-heading-text;
        letter-spacing: .1rem;
        padding-bottom: .5rem;
        margin-bottom: 1.75rem;

        .text-lg;
        .border-top-radius(@dash-widget-border-radius);

        // the cog icon to open the config modal
        .widget-settings-icon {
            .transition(color 300ms ease);

            &:hover {
                color: @dash-dashboard-text-hover;
            }
        }
        .last-updated {
            font-size: 1.1rem;
        }
    }
    .widget-heading-performance {
        border-bottom: 0px solid @dash-widget-heading-border;
        color: @dash-widget-heading-text;
        letter-spacing: .1rem;
        padding-bottom: .5rem;
        margin-bottom: 1.75rem;

        .text-lg;
        .border-top-radius(@dash-widget-border-radius);

        .widget-settings-icon {
            .transition(color 300ms ease);

            &:hover {
                color: @dash-dashboard-text-hover;
            }
        }
        .last-updated {
            font-size: 1.1rem;
        }
    }
    // sections of widgets should have the same widget markup
    // but may be styled slightly differently
    .widget-body .widget {
        padding: 0;

        .widget-heading {
            border-bottom-color: @dash-widget-sub-heading-border;
            .text-standard;
            text-transform: uppercase;
        }
    }

    // when widget hasn't yet been configured
    .widget-body-config {
        background: @dash-widget-section-highlight;
        border: .5rem dashed @dash-state-config-text;
        border-radius: 1rem;
        color: @dash-state-config-text;
        display: none;
        font-size: 2rem;
        line-height: 2.4rem;
        margin: 1rem 0;
        padding: 2rem;
        text-align: center;

        .fa {
            border: 2px solid @dash-state-config-text;
            margin-bottom: .75rem;
            padding: .6rem .5rem;
            .border-radius(50%);

            .transition(border-color 300ms linear);
        }


        .transition(~"all 300ms linear");
    }

    // changes when not yet configured
    &.configure {
        .widget-settings-icon {
            display: none;
        }

        .widget-body-main {
            display: none;
        }

        .widget-body-config {
            display: block;

            &:hover {
                background-color: @dash-state-config-bg-hover;
                border-color: @dash-state-config-text-hover;
                color: @dash-state-config-text-hover;

                .fa {
                    border-color: @dash-state-config-text-hover;
                }
            }
        }
    }

    // styles when in an alert state
    &.alert {
        #gradient > .vertical(lighten(@dash-widget-alert-bg, 10%), darken(@dash-widget-alert-bg, 10%));
        color: @dash-widget-alert-text;

        .widget-heading {
            border-bottom-color: @dash-widget-alert-heading-border;
            color: @dash-widget-alert-text;
        }
    }
}

.cicd-modal-content {
  margin-left: 10%;
}

// WIDGET-MODAL
// ========================================
// config modal when markup is wrapped in a widget-modal directive
.widget-modal {
    padding: 1rem 5rem 3rem;

    .widget-modal-close {
        background: transparent;
        cursor: pointer;
        color: @text-color;
        font-weight: bold;
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
        border: 0;
        background-clip: padding-box;
        text-align: center;
        opacity: .7;
        font-size: 1.5em;
        line-height: 1em;
        .transition(opacity .2s linear);

        &:hover {
            opacity: 1;
        }
    }

    .widget-modal-heading {
        border-bottom: 1px solid @dash-modal-heading-border;
        color: @dash-modal-heading-text;
        font-size: 2.5rem;
        margin-bottom: 3rem;
        padding: 1rem;
        text-align: center;
    }

    .widget-modal-heading-markup {
        border-bottom: 1px solid @dash-modal-heading-border;
        padding-bottom: 8px;
    }

    .text-danger {
        color: @state-danger-text !important;
    }

    .text-success {
        color: @state-success-text !important;
    }

    .fa, .glyphicon {
        color: @dash-modal-icon-text;
    }

    .btn .fa, .btn .glyphicon {
        color: inherit;
    }

    .widget-modal-body {
        .modal-label {
            font-weight: 600;
            width: 100%;
            text-align: center;
        }

        .widget-modal-divider, hr {
            border-bottom: 1px solid @dash-modal-divider;
            height: 1px;
        }
    }
}

// WIDGET-DETAIL
// ========================================
// styles for detail/expanded view modals
.widget-detail {
    padding: 1rem 5rem 3rem;
    .text-lg;
    color: @dash-detail-heading-text;

    .widget-detail-heading {
        border-bottom: 1px solid @dash-detail-divider;
        margin-bottom: 3rem;
        padding: 1rem;
    }

    .widget-detail-body {
        .table {
            border-collapse: separate;
            th {
                .text-standard;
                padding: 4px;
                font-weight: 900;
                border-bottom: 1px solid @dash-detail-divider;
                table-layout: fixed;
            }
            td {
                padding: 4px;
                word-wrap: break-word;
            }
        }
    }

    .detail-close {
        position: absolute;
        right: .4rem;
        top: .4rem;
        color: @dash-detail-icon-text;
        &:hover {
            color: lighten(@dash-detail-icon-text, 50%);
        }
    }
}

tr.dash-row > td {
    border-top: none !important;
    padding: 0 !important;
    line-height: 3.25rem;
    vertical-align: middle !important;
}

.dash-row {
    @dash-row-height: 3.25rem;

    .clearfix;
    line-height: @dash-row-height;
    vertical-align: middle;

    .fa {
        line-height: @dash-row-height;
        margin-right: .5rem;
    }

    &.clickable:hover {
        background-color: @dash-widget-section-highlight;
    }
}

// to be used with rows that have icons on the left or right and need the text to show as an
// ellipsis if it's too big. if icons on both sides the right icon should be before the element
// with this class
.dash-overflow {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.dash-modal-row {
    border-top: 1px solid @dash-divider-light;
    padding: .8rem 0;

    &:first-of-type {
        border-top: none;
    }
}

.dash-progress-bar {
    @bar-height: 3rem;

    > div {
        float: left;
        height: @bar-height;
        //        margin-left: -@bar-height/2;

        .border-right-radius(@bar-height / 2);

        background-color: @dash-status-warn;
        z-index: 2;

        &:first-child {
            z-index: 3;
            background-color: @dash-status-pass;
        }

        &:last-child {
            z-index: 1;
            background-color: @dash-widget-section-highlight;
        }

    }
}

// DASH-STATUS
.dash-status {
    min-width: 3rem;
    text-align: center;

    .dash-status-pass {
        color: @dash-status-pass;
        .text-lg;
    }

    .dash-status-warn {
        color: @dash-status-warn;
        .text-lg;
    }

    .dash-status-fail {
        display: inline-block;
        font-weight: bold;
        width: 2rem;
        height: 2rem;
        background: @dash-status-fail;
        border: .2rem solid @dash-status-fail-border;
        color: @dash-status-fail-text;
        line-height: 1.75rem;
        .border-radius(50%);
    }

    .dash-status-ignore {
        display: inline-block;
        font-weight: bold;
        width: 2rem;
        height: 2rem;
        background: @dash-status-ignore;
        border: .2rem solid @dash-status-ignore-border;
        color: @dash-status-ignore-text;
        line-height: 1.75rem;
        .border-radius(50%);
    }

    .dash-status-critical {
        display: inline-block;
        font-weight: bold;
        width: 2rem;
        height: 2rem;
        background: black;
        border: .2rem solid @dash-status-fail-border;
        color: @dash-status-fail;
        line-height: 1.75rem;
        .border-radius(50%);
    }
}

.dash-status-lg {
    .dash-status {
        margin: .1em 0;
    }
    .dash-status-fail {
        width: 2.75rem;
        height: 2.75rem;
        line-height: 2.4rem;
    }
}

.widget.alert .dash-status {
    .dash-status-pass {
        color: @dash-status-alert-pass !important;
    }

    .dash-status-warn {
        color: @dash-status-alert-warn !important;
    }

    .dash-status-fail {
        background-color: @dash-status-alert-fail !important;
    }
}

.widget-font-pass {
    color: @dash-status-pass !important;
}

.widget-font-fail {
    color: @dash-status-fail !important;
}

.widget-font-warn {
    color: @dash-status-warn !important;
}

.widget-font-bold{
    font-weight: bolder;
}

// ADMIN
// ========================================
#admin {
    padding-top: 5rem;

    .delete-dashboard-row {
        line-height: 4rem;
        padding: 1rem 0;
        font-size: 2rem;
    }

    .listDashboards {
        .animate-appear();
    }

    .themes {
        position: absolute;
        top: 5rem;
        right: 2rem;
    }
    .cssConfigOdd{
     background-color: #e4e4e4;
    }
    .cssConfigEven{
     background-color: #e8e8e8;
    }
    .configApplyPadd{
        padding: 10px 0px 0px 0px;
    }
    .inputBoxStyle{
        border: 1px solid #0078d2;
    }
    .confHeaderIcon{
        cursor: pointer;
        width: 20px;
        height: 20px;
    }
    ul.tooltipList {
        list-style-type: none;
        margin: 0;
        padding: 0;
    }
    ul.tooltipList li{
        margin: 0;
        padding: 0;
        text-align: left;
    }
}

// DASHBOARD
// ========================================
#dashboard {
    background: @dash-dashboard-bg;
    color: @dash-dashboard-text;

    // styles for chartist charts
    .ct-label {
        .text-standard;
    }

    .ct-wrapper {
        position: relative;



        // better style donut charts
        &.dash-donut-wrapper {
            .ct-chart {
                margin-bottom: -50%;
            }

            .donut-number {
                width: 30%;
                height: 30%;
                left: 30%;
                top: 45%;
            }

            .donut-number-percent {
                left: 65%;
                top: 50%;
            }
        }

        // to show a number and percent inside a pie chart
        .donut-number {
            display: inline-block;
            width: 40%;
            height: 40%;
            top: 30%;
            left: 30%;
            text-align: center;
            position: absolute;
        }
        .guage-number {
            display: inline-block;
            width: 40%;
            bottom: 48%;
            left: 30%;
            text-align: center;
            position: absolute;
        }
    }
}

#auth {
    background-image: url('@{dash-image-path}bg-forest.jpg');
    color: @dash-dashboard-text;
    padding-top: 50px;

    .auth-modal-tab {
        a {
            color: white;
        }

        &:hover a, &.active a {
            color: black;
        }
    }


    .auth-modal-heading {

        color: white;
        font-size: 2.5rem;
        margin-bottom: 3rem;
        padding: 1rem;
        text-align: center;
    }
    .auth-modal-body {
        .modal-label {
            font-weight: 600;
            width: 100%;
            text-align: center;
        }
    }
    .auth-modal-footer {
        .top-buffer {
            margin-top: 20px;
            text-align: center;
        }
        .animate-hide {
            transition: all linear 0.5s;
            line-height: 20px;
            opacity: 1;
            padding: 10px;
            background: none;
        }

        .animate-hide.ng-hide {
            line-height: 0;
            opacity: 0;
            padding: 0 10px;
        }

        .check-element {
            padding: 10px;
            border: 1px solid black;
            background: none;
        }
    }

    .navbar {
        margin-bottom: 1.3em;
        background: transparent;
    }
    .navbar-default {
        border: none;
    }
    .navbar-toggle {
        border: rgba(0, 0, 0, 0.4);
    }

    .navbar-default .navbar-nav > li > a {
        color: #d7d7d7;
    }

    .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
        background-color: rgba(0, 0, 0, 0.4);
    }
}

.cicd-gates {
  .na-gate {
    font-size:2rem;
  }
}

// AUTO LOOP
// ========================================
// CSS for widgets with multiple tabs/screens to loop through (using play/pause buttons)

#next-btn {
    background: none;
    border: 0;
    color: @dash-status-ignore;
}
#pause-btn {
    background: none;
    border: 0;
    color: @dash-status-warn;
}
#play-btn {
    background: none;
    border: 0;
    color: @dash-status-pass;
}
#next-btn:hover, #pause-btn:hover, #play-btn:hover {
    background-color: @dash-widget-section-highlight;
    opacity: 0.5;
}